.thread-page.mt-12
  %main.v-main
    %div.v-container.thread-page.max-width-800.px-0.px-sm-3.v-locale--is-ltr
      %div.thread-card.v-sheet.theme--auto.v-sheet--outlined.elevation-1.rounded
        %div#context.context-panel
          %div.d-flex.align-center.mr-3.ml-2.pt-2.text-body-2
            %ul.v-breadcrumbs.v-breadcrumbs--density-default.context-panel__breadcrumbs
              %li.v-breadcrumbs-item.text-anchor.py-1.ml-n2
                %a.v-breadcrumbs-item--link{href: group_url(@discussion.group)}
                  =@discussion.group.full_name
          %h1#sequence-0.text-h4.context-panel__heading.px-3= @discussion.title
          .mx-3.mb-2
            .context-panel__details.my-2.text-body-2.align-center.d-flex.text-medium-emphasis
              %span.mr-2
                = render "base_mailer/avatar", user: @discussion.author
              %span.text-medium-emphasis
                %a{:href => user_url(@discussion.author)}=@discussion.author.name
                %span
                  %span{"aria-hidden" => "true"} ·
                  = render 'discussions/time_ago', time: @discussion.created_at
                %span
                  %span{"aria-hidden" => "true"} ·
                - if @discussion.private
                  %span.nowrap.context-panel__discussion-privacy.context-panel__discussion-privacy--private
                    %i.mdi.mdi-lock-outline
                    %span= t(:'common.privacy.private')
                -else
                  %span.nowrap.context-panel__discussion-privacy.context-panel__discussion-privacy--public
                    %i.mdi.mdi-earth
                    %span= t(:'common.privacy.public')
                %span
                  %span{"aria-hidden" => "true"} ·
                  %span.context-panel__seen_by_count= t(:'discussion_context.seen_by_count', count: @discussion.seen_by_count)
            .lmo-markdown-wrapper.text-body-1.text--primary.context-panel__description
              = formatted_text(@discussion, :body)
        .activity-panel
          - items = @discussion.items.includes(:eventable, :user).order("position_key #{@discussion.newest_first ? 'desc' : 'asc'}").where(kind: ['new_comment', 'poll_created', 'stance_created', 'stance_updated'])
          - items.limit(@pagination[:limit]).offset(@pagination[:offset]).each do |item|
            - if item.eventable.present?
              = render "discussions/thread_items/thread_item", item: item
          - if (@pagination[:offset] + @pagination[:limit]) < items.count
            %a{href: "?offset=#{@pagination[:offset]+@pagination[:limit]}&limit=#{@pagination[:limit]}&export=1"}= t(:'common.action.load_more')
